package study.mq.kafka.consumer.listener._1_consumer;

import lombok.extern.slf4j.Slf4j;
import org.apache.kafka.clients.consumer.Consumer;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class _1_ConsumerListener {

    @KafkaListener(topics = "test222")
    public void onMessage(ConsumerRecord<String, String> record) {
        //
        String topic = record.topic();
        int partition = record.partition();
        String key = record.key();
        String value = record.value();
        //
        long offset = record.offset();

        log.info("topic= {}, value= {}", topic, value);
    }
}
